using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace FB.WinForms.Controls
{
	/// <summary>
	/// The AnchorDialog form is used by the <see cref="HtmlDropDownListItemsEditorUI"/>
	/// to enter the Anchor tag.
	/// </summary>
	public class AnchorDialog : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label labelId;
		private System.Windows.Forms.TextBox textBoxId;
		private System.Windows.Forms.Button buttonOK;
		private System.Windows.Forms.Button buttonCancel;
		private System.Windows.Forms.TextBox textBoxDisplayText;
		private System.Windows.Forms.Label labelText;

		private System.ComponentModel.Container components = null;

		/// <summary>
		/// Creates a new <see cref="AnchorDialog"/> instance.
		/// </summary>
		public AnchorDialog()
		{
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.labelId = new System.Windows.Forms.Label();
			this.labelText = new System.Windows.Forms.Label();
			this.textBoxId = new System.Windows.Forms.TextBox();
			this.textBoxDisplayText = new System.Windows.Forms.TextBox();
			this.buttonOK = new System.Windows.Forms.Button();
			this.buttonCancel = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// labelId
			// 
			this.labelId.Location = new System.Drawing.Point(24, 16);
			this.labelId.Name = "labelId";
			this.labelId.Size = new System.Drawing.Size(40, 23);
			this.labelId.TabIndex = 0;
			this.labelId.Text = "Id:";
			this.labelId.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// labelText
			// 
			this.labelText.Location = new System.Drawing.Point(20, 40);
			this.labelText.Name = "labelText";
			this.labelText.Size = new System.Drawing.Size(40, 23);
			this.labelText.TabIndex = 1;
			this.labelText.Text = "Text:";
			this.labelText.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// textBoxId
			// 
			this.textBoxId.Location = new System.Drawing.Point(96, 16);
			this.textBoxId.Name = "textBoxId";
			this.textBoxId.Size = new System.Drawing.Size(280, 20);
			this.textBoxId.TabIndex = 1;
			this.textBoxId.Text = "";
			// 
			// textBoxDisplayText
			// 
			this.textBoxDisplayText.Location = new System.Drawing.Point(96, 40);
			this.textBoxDisplayText.Name = "textBoxDisplayText";
			this.textBoxDisplayText.Size = new System.Drawing.Size(280, 20);
			this.textBoxDisplayText.TabIndex = 2;
			this.textBoxDisplayText.Text = "";
			// 
			// buttonOK
			// 
			this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.buttonOK.Location = new System.Drawing.Point(224, 72);
			this.buttonOK.Name = "buttonOK";
			this.buttonOK.TabIndex = 3;
			this.buttonOK.Text = "OK";
			// 
			// buttonCancel
			// 
			this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.buttonCancel.Location = new System.Drawing.Point(304, 72);
			this.buttonCancel.Name = "buttonCancel";
			this.buttonCancel.TabIndex = 4;
			this.buttonCancel.Text = "Cancel";
			// 
			// AnchorDialog
			// 
			this.AcceptButton = this.buttonOK;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.CancelButton = this.buttonCancel;
			this.ClientSize = new System.Drawing.Size(384, 102);
			this.Controls.Add(this.buttonOK);
			this.Controls.Add(this.buttonCancel);
			this.Controls.Add(this.textBoxDisplayText);
			this.Controls.Add(this.textBoxId);
			this.Controls.Add(this.labelText);
			this.Controls.Add(this.labelId);
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "AnchorDialog";
			this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
			this.Text = "HtmlDropDown Anchor Editor";
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// Gets the Id value of the anchor.
		/// </summary>
		public string Id
		{
			get { return textBoxId.Text; }
		}

		/// <summary>
		/// Gets the DisplayText of the anchor.
		/// </summary>
		public string DisplayText
		{
			get { return textBoxDisplayText.Text; }
			set { textBoxDisplayText.Text = value; }
		}
	}
}
